package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the ORGANIZATION_STRUCTURE database table.
 * 
 */
@Entity
@Table(name="ORGANIZATION_STRUCTURE")
@NamedQuery(name="OrganizationStructure.findAll", query="SELECT o FROM OrganizationStructure o")
public class OrganizationStructure implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ORGANIZATION_STRUCTURE_ORGANSID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ORGANIZATION_STRUCTURE_ORGANSID_GENERATOR")
	@Column(name="ORGANS_ID")
	private long organsId;

	@Column(name="ORGANS_ENDDATE")
	private Timestamp organsEnddate;

	@Column(name="ORGANS_REMARK")
	private String organsRemark;

	@Column(name="ORGANS_STARTDATE")
	private Timestamp organsStartdate;

	@Column(name="ORGANS_STATE")
	private Integer organsState;

	@Column(name="VERSION_NAME")
	private String versionName;

	//bi-directional many-to-one association to OrganizationArea
	@OneToMany(mappedBy="organizationStructure")
	@JSONField(serialize = false)
	private List<OrganizationArea> organizationAreas;

	public OrganizationStructure() {
	}

	public long getOrgansId() {
		return this.organsId;
	}

	public void setOrgansId(long organsId) {
		this.organsId = organsId;
	}

	public Timestamp getOrgansEnddate() {
		return this.organsEnddate;
	}

	public void setOrgansEnddate(Timestamp organsEnddate) {
		this.organsEnddate = organsEnddate;
	}

	public String getOrgansRemark() {
		return this.organsRemark;
	}

	public void setOrgansRemark(String organsRemark) {
		this.organsRemark = organsRemark;
	}

	public Timestamp getOrgansStartdate() {
		return this.organsStartdate;
	}

	public void setOrgansStartdate(Timestamp organsStartdate) {
		this.organsStartdate = organsStartdate;
	}

	public Integer getOrgansState() {
		return this.organsState;
	}

	public void setOrgansState(Integer organsState) {
		this.organsState = organsState;
	}

	public String getVersionName() {
		return this.versionName;
	}

	public void setVersionName(String versionName) {
		this.versionName = versionName;
	}

	public List<OrganizationArea> getOrganizationAreas() {
		return this.organizationAreas;
	}

	public void setOrganizationAreas(List<OrganizationArea> organizationAreas) {
		this.organizationAreas = organizationAreas;
	}

	public OrganizationArea addOrganizationArea(OrganizationArea organizationArea) {
		getOrganizationAreas().add(organizationArea);
		organizationArea.setOrganizationStructure(this);

		return organizationArea;
	}

	public OrganizationArea removeOrganizationArea(OrganizationArea organizationArea) {
		getOrganizationAreas().remove(organizationArea);
		organizationArea.setOrganizationStructure(null);

		return organizationArea;
	}

}